//
//  UIImageView+Addtions.m
//  EpointFrame5
//
//  Created by Pill Gong on 14-4-18.
//  Copyright (c) 2014年 Epoint. All rights reserved.
//

#import "UIImageView+Addtions.h"

@implementation UIImageView (Addtions)

+ (UIImageView *)getColorLine:(UIColor *)color {
    return [self getColorLine:color width:AppWidth];
}

+ (UIImageView *)getColorLine:(UIColor *)color width:(CGFloat)width {
    return [self getColorLine:color width:width alpha:0.5];
}

+ (UIImageView *)getColorLine:(UIColor *)color alpha:(CGFloat)alpha {
    return [self getColorLine:color width:AppWidth alpha:alpha];
}

+ (UIImageView *)getColorLine:(UIColor *)color width:(CGFloat)width alpha:(CGFloat)alpha {
    return [self getColorLine:color width:width alpha:alpha floatValue:0];
}

+ (UIImageView *)getColorLine:(UIColor *)color width:(CGFloat)width alpha:(CGFloat)alpha floatValue:(CGFloat)floatValue {
    UIImageView *line;
    if (floatValue < 0) {
        line = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width+floatValue, 1)];
    } else {
        line = [[UIImageView alloc] initWithFrame:CGRectMake(floatValue, 0, width-floatValue, 1)];
    }
    line.backgroundColor = color;
    line.alpha = alpha;
    return line;
}

@end
